package com.zqx.strategy.specificstrategy;

import com.zqx.strategy.abstractstrategy.Discount;
import lombok.extern.slf4j.Slf4j;

/**
 * description: 具体策略类
 * @author zqx
 * @date 2018/09/04
 */
@Slf4j
public class ChildrenDiscount implements Discount {

    private final double DISCOUNT = 10;
    @Override
    public double calculate(double price) {
        System.out.println("测试");
        System.out.println("在测");
        System.out.println("小二郎");
        log.info("【儿童票】");
        System.out.println("测试");
        if(price >= 20){
            return price-DISCOUNT;
        }else{
            return price;
        }
    }
}
